
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 1
 * @Author : WangRuoyu 
 * @Date : 2023/5/17 17:25
 */

#include "iostream"

using namespace std;

int main() {
    int n;
    cin >> n;
    int res = 0;
    for (int i = 0; i < n; ++i) {
        int w, s;
        scanf("%d %d", &w, &s);
        res += w * s;
    }
    cout << max(0, res);
    return 0;
}